SET QUOTED_IDENTIFIER ON
GO
SET ANSI_NULLS ON
GO
create proc [dbo].[GetBookingByHotelID]
(
	@HotelID int
)
as 
select b.PaymentID, b.CustomerID as CustomerBookingID, b.CardNo, b.TotalPaid, b.CheckInDate, b.CheckOutDate, b.Status
,b.CardHolder, b.CardNumber, b.CreatedDate as BookingCreateDate, b.ModifiedDate as BookingModifieDate,
h.HotelName, h.Prices,c.FirstName, c.MiddleName, c.LastName, c.FullName, c.Address, c.Passport, c.Phone,
c.Email, c.Fax
from Bookings b 
inner join Hotels as h on b.HotelID = h.ID
inner join Customers as c on b.CustomerID = c.Id
where b.HotelID = @HotelID
GO
